function validate() {
	var userid = document.getElementById("regform:userid");
	var name = document.getElementById("regform:name");
	var email = document.getElementById("regform:email");
	var dobMonth = document.getElementById("regform:dobMonth");
	var dobDate = document.getElementById("regform:dobDate");
	var emailformat = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;

	if(isNaN(userid.value) || userid.value.length != 6) {
		alert("Please enter your 6 digit user id");
		userid.value="";
		userid.focus();
	} else if (name.value.length == 0) {
		alert ("Please enter your name");
		name.focus();
	} else if (!emailformat.test(email.value)) {
		alert ("Please enter a valid email id");
		email.value="";
		email.focus();
	} else if (dobMonth.value == "Select Month") {
		alert ("Please select your DOB Month");
		dobMonth.focus();
	} else if(dobDate.value == "Select Date") {
		alert ("Please select your DOB Date");
		dobDate.focus();
	} else {
		return true;
	}
	return false;
}

function validateimg() {
	var imageTxt = document.getElementById("imageform:imagetxt");
	if (imageTxt.value.length == 0) {
		alert ("Please enter who's birthday it is");
		imageTxt.focus();
		return false;
	}
	return true;
}